package com.ymx.darling.mapper.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * 代理工厂
 * @author 爱Java的小于
 */
public class DarlingProxyFactory {
    public static <T> T newInstance(Class<T> proxyInterface, InvocationHandler invocationHandler) {
        return (T)Proxy.newProxyInstance(
                proxyInterface.getClassLoader(),
                new Class[]{proxyInterface},
                invocationHandler);
    }
}
